import { http } from "..";
import * as ResultType from './type';
export const GetEmergencyPaging = (date = { startTime: "2025-01-01 00:00:00", endTime: "2025-02-10 00:00:00" }) => http.get<any>({ url: "/multipleAnalysis/pageInfo", data: date });

//事故详情接口
export const AccidentDetails = (data = { id: '' }) => http.get<any>({ url: `/multipleAnalysis/detail?id=${data}` });
// export const AccidentDetails = (ids: string) => http.post<ResultType.ApiResponse>({ url:`/map/accidentHeatMapDetailByReason`, data:[ids] });
// 获取事故原因
export const GetAccidentCause = () => http.get<ResultType.AccidentResults>({ url: "/map/reason" });

// 获取事故形态
export const GetAccidentPattern = () => http.get<ResultType.AccidentResults>({ url: "/map/form" });
// 获取事故地图数据
export const GetAccident = (date = { startTime: "2024-12-01 00:00:00", endTime: "2025-01-01 00:00:00" }) => http.get<ResultType.AccidentResult>({ url: "/map/accident", data: date });

// 事故地图热力图信息
export const GetAccidentHeatMap = (date = { startTime: "", endTime: "" }) => http.get<ResultType.HeatMapResult>({ url: "/map/accidentHeatMap", data: date });

// 获取施工地图信息
export const GetConstruction = (date = { startTime: "", endTime: "" }) => http.get<ResultType.ConstructionResult>({ url: "/map/construction", data: date });

// 获取施工热力图信息
export const GetConstructionHeatMap = (date = { startTime: "", endTime: "" }) => http.get<ResultType.HeatMapResult>({ url: "/map/constructionHeatMap", data: date });

// 获取警情地图信息
export const GetAlarm = (date = { startTime: "", endTime: "" }) => http.get<ResultType.AlarmResult>({ url: "/map/alarm", data: date });

// 获取警情热力图信息
export const GetAlarmHeatMap = (date = { startTime: "", endTime: "" }) => http.get<ResultType.HeatMapResult>({ url: "/map/alarmHeatMap", data: date });

// 获取违法地图数据
export const GetVioSurveil = (date = { startTime: "", endTime: "" }) => http.get<ResultType.VioSurveilResult>({ url: "/map/vioSurveil", data: date });

// 获取违法热力图信息
export const GetVioSurveilHeatMap = (date = { startTime: "", endTime: "" }) => http.get<ResultType.HeatMapResult>({ url: "/map/vioSurveilHeatMap", data: date });

// 获取亡人事故地图数据
export const GetDeathAccident = (date = { startTime: "", endTime: "" }) => http.get<ResultType.VioSurveilResult>({ url: "/map/deathAccident", data: date });

// 获取亡人事故热力图信息
export const GetDeathAccidentHeatMap = (date = { startTime: "", endTime: "" }) => http.get<ResultType.HeatMapResult>({ url: "/map/deathAccidentHeatMap", data: date });

// 热力图信息列表
export const PostHeatMapDetail = (url: string, ids = []) => http.post<any[]>({ url: `/map/${url}HeatMapDetail`, data: ids });

// 事故热力图原因分析接口
export const GetAccidentHeatMapByReason = (date = { startTime: "", endTime: "" }) => http.get<any[]>({ url: `/map/accidentHeatMapByReason`, data: date });

// 事故热力图原因分析信息列表
export const PostAccidentHeatMapDetailByReason = (ids = []) => http.post<any[]>({ url: `/map/accidentHeatMapDetailByReason?ids=${ids}`, data: ids });

// 事故维度原因分析信息列表
export const GetstatisticHeatMap = (data = { startTime: "", endTime: "", radius: '200', minPoints: '1' }) => http.get<ResultType.HeatMapResult>({ url: `/map/accidentHeatMapByAnalysis`, data: data });

//饼状图统计接口群
export const PostPieChartDetail = (url: string, ids = []) => http.post<any[]>({ url: `/map/acdCountBy${url}`, data: ids });
//饼状图列表返回
export const PostPieChartDetailList = (data = []) => http.post<any[]>({ url: `/map/pageInfo`, data: data });
export const GetUrl = (deviceId = '') => http.get<any>({ url: `/heatMap/play?deviceId=${deviceId}` });
export const Getjiankong = () => http.get<any>({ url: `/map/camera` });
export const GetSearchMonitoring = (keyWord = '') => http.get<any>({ url: `/map/camera`, data: { keyWord } });
export const PostAccidentHeatMapDetail = (ids = []) => http.post<any>({ url: `/map/accidentHeatMapDetail`, data: ids });

export const PostReportPageInfo = (data) => http.post<any>({ url: `/heatMap/reportPageInfo`, data: data });

export const PostAccidentHeatpictur = (file) => http.post<any>({ url: `/file/uploadImage`, data: file });

export const PostSave = (file) => http.post<any>({ url: `/image/save`, data: file });

//往年同期事故数
export const GetAcdData = () => http.get<any>({ url: `/heatMap/getAcdData` });
//人员详情
export const PostPolicePageInfo = (data) => http.post<any>({ url: `/police/pageInfo` ,data: data });
//事故维度对比接口
export const GetCompareAnalysis = (data = { startTime: "2025-01-01 00:00:00", endTime: "2025-08-10 00:00:00", radius: '200', minPoints: '1' }) => http.get<any>({ url: `/heatMap/compareAnalysis` ,data:data });

//热力图事故列表
export const GetAccidentPageInfo = (data = { pageSize: "10", pageNum: "1", ids:[] }) => http.post<any>({ url: `/heatMap/accidentPageInfo` ,data:data });


export const GetIp = () => http.get<any>({ url: `/home/ip` });

export const GetAnalysisByAddress = (data = { startTime: "", endTime: "", radius: '200', minPoints: '5' }) => http.get<ResultType.HeatMapResult>({ url: `/heatMap/analysisByAddress`, data: data });
